﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace PaintDotNetForms
{
    public delegate void SizeChange(Size size);
    public abstract class Figure
    {
        abstract public event SizeChange SizeChangeEvent;

        protected Point startPoint;
        protected Point endPoint;
        protected Pen pen;
        protected Brush brush;

        private Filling filling;
        public Filling Filling
        {
            get { return filling; }
            set { filling = value; }
        }
        
        private bool shiftIsDown = false;
        public bool ShiftIsDown
        {
            get { return shiftIsDown; }
            set { shiftIsDown = value; }
        }

        public abstract void draw(System.Drawing.Graphics g);

        public void setPen(System.Drawing.Pen pen)
        {
            this.pen = pen;
        }

        public void setDashStyle(System.Drawing.Drawing2D.DashStyle dashStyle)
        {
            this.pen.DashCap = System.Drawing.Drawing2D.DashCap.Round;
            this.pen.DashStyle = dashStyle;
        }

        public void setBrush(System.Drawing.Brush brush)
        {
            this.brush = brush;
        }

        public void setDashCap(DashCap dashCap)
        {
            this.pen.DashCap = dashCap;
        }
        
        public virtual void setStartPoint(System.Drawing.Point startPoint)
        {
            this.startPoint = startPoint;            
        }

        public virtual void setEndPoint(System.Drawing.Point endPoint)
        {
            this.endPoint = endPoint;
        }
    }
}
